package com.coldchain.order.entity;

import org.apache.commons.lang3.StringUtils;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fangliai.core.entitiy.BaseSearch;

public class OrderSearch extends BaseSearch{
	public static final String ORDER_BY_SORT=" bp.sort";
	private String orderid; //订单ID
	
	private String companyid;//货主ID
	 
	private String cysid;//承运商ID

	private String driverId;

	private Integer status;


	public String getOrderid() {
		return orderid;
	}

	public void setOrderid(String orderid) {
		this.orderid = orderid;
	}

	public String getCompanyid() {
		return companyid;
	}

	public void setCompanyid(String companyid) {
		this.companyid = companyid;
	}

	public String getCysid() {
		return cysid;
	}

	public void setCysid(String cysid) {
		this.cysid = cysid;
	}

	public String getDriverId() {
		return driverId;
	}

	public void setDriverId(String driverId) {
		this.driverId = driverId;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	@Override
	public QueryWrapper<Order> initWrapper() {
		QueryWrapper<Order> queryWrapper=new QueryWrapper<>();
		if(StringUtils.isNotEmpty(orderid)){
			 queryWrapper.eq("o.orderId",orderid);
		}
		if(StringUtils.isNotEmpty(companyid)){
			queryWrapper.eq("o.companyId",companyid);
		}
		if(StringUtils.isNotEmpty(cysid)){
			queryWrapper.eq(" bo.cysId",cysid);
		}
		if(StringUtils.isNotEmpty(driverId)){
			queryWrapper.eq(" bo.driverId",driverId);
		}
		if(status!=null){
			queryWrapper.eq("bo.status",status);
		}

		return queryWrapper;
	}
	


}
